package com.javabasic.algorithm.newcode;

import java.util.Scanner;

/**
 * @Author xiongmin
 * @ClassName TheRobotPlow
 * @Description TODO
 * @Date 2019/9/1 15:41
 * @Version 1.0
 **/
public class TheRobotPlow {
    static Scanner cin = new Scanner(System.in);

    static int[][] arr = null;
    static int n, m, line;

    public static void main(String[] args) {
        n = cin.nextInt();
        m = cin.nextInt();
        line = cin.nextInt();
        arr = new int[n + 1][m + 1];
        int leftx, lefty, rightx, righty;
        for (int i = 0; i < line; i++) {
            leftx = cin.nextInt();
            lefty = cin.nextInt();
            rightx = cin.nextInt();
            righty = cin.nextInt();

            cover(leftx, lefty, rightx, righty);
        }

        int reault = caculate();
        System.out.println(reault);
    }

    private static int caculate() {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                if (arr[i][j] == 1) {
                    sum++;
                }

            }
        }
        return sum;

    }

    private static void cover(int leftx, int lefty, int rightx, int righty) {
        for (int i = leftx; i <= rightx; i++) {
            for (int j = lefty; j <= righty; j++) {
                arr[i][j] = 1;
            }
        }
    }


}
